package cate.game.activity.luckybag;

import cate.common.table.d.GDFunc;
import cate.game.activity.base.core.Activity;
import cate.game.activity.base.core.ActivityHandler;

@Activity(relatedFuncIds = {GDFunc.LUCKY_BAG})
public class LuckyBagActivityHandler extends ActivityHandler<LuckyBagGlobalData, LuckyBagActivity> {
    @Override
    public String getName() {
        return "幸运福袋";
    }

    @Override
    public LuckyBagGlobalData buildGlobal() {
        return new LuckyBagGlobalData();
    }

    @Override
    public LuckyBagActivity buildSingle() {
        return new LuckyBagActivity();
    }

    @Override
    public void onActOpen() {

    }

    public synchronized void addScore(long num) {
        getGlobalData().addScore(num);
    }

    public long getScore() {
        return getGlobalData().score;
    }

    @Override
    public void onActClose() {
        getGlobalData().clear();
    }
}
